#ifndef __APP_ENCRYPTION_H__
#define __APP_ENCRYPTION_H__

#include <stdint.h>
#include <string.h>
#include <stdio.h>

// 算法类型枚举
typedef enum {
    HASH_SHA256,
    HASH_HMAC_SHA256
} hash_algorithm_t;
int compute_hash(uint8_t *output, 
    const uint8_t *input, size_t input_len,
    const uint8_t *key, size_t key_len,
    hash_algorithm_t algo);

// 加密算法类型枚举
typedef enum {
    AES_ECB_MODE,
    AES_CBC_MODE
} aes_mode_t;

// AES上下文结构体（假设已定义）
typedef struct {
    uint8_t RoundKey[176]; // AES-256扩展密钥
    uint8_t Iv[16];        // CBC模式需要的IV
} AES_ctx;


int compute_hash(uint8_t *output, 
    const uint8_t *input, size_t input_len,
    const uint8_t *key, size_t key_len,
    hash_algorithm_t algo);

void Init_Key_AND_Iv();
int encrypt_to_base64(const uint8_t *plaintext, size_t plaintext_len, int mode, char **base64_output); 
int base64_to_decrypt(const char *base64_input, int mode, uint8_t *output, size_t output_size);
#endif /* __APP_ENCRYPTION_H__ */
		